package com.naszetatry.controller;

import javax.servlet.http.HttpServletRequest;
import com.naszetatry.login.LValidation;

/**
 * 
 * @author Maciej Koch
 * Kontroler logowania
 */
public class LoginController {
	private static final String loginValidation = "lValidation";
	
	/**
	 * Pobiera liste bledow w logowaniu
	 * @param request
	 * @return
	 */
	public static LValidation getValidation(HttpServletRequest request) {
		LValidation validation = (LValidation)request.getAttribute(loginValidation);
		if(validation != null)
			return validation;
		return new LValidation();
	}
	/**
	 * Ustawia liste bledow w logowaniu
	 * @param request
	 * @param validation
	 * lista bledow
	 */
	public static void setValidation(HttpServletRequest request, LValidation validation) {
		request.setAttribute(loginValidation, validation);
	}
}
